<template>
	<view>
		<view class="cu-bar bg-white search">
			<view>
				<scroll-view scroll-x class=" nav text-left">

					
					<view class="cu-item" :class="1==TabCur?'text-yellow text-xxl cur':''" @tap="tabSelect" data-id="1">
						法币
					</view>
					<!-- <view class="cu-item" :class="0==TabCur?'text-yellow text-xxl cur':''" @tap="tabSelect" data-id="0">
						{{i18n.order.type1}}
					</view>
					<view class="cu-item" :class="2==TabCur?'text-white text-xxl cur':''" @tap="tabSelect" data-id="2">
						商户
					</view> -->
				</scroll-view>
			</view>

			<!-- <view class="action">
				<text class="cuIcon-more" @tap="actionSheetTap"></text>
			</view> -->
		</view>

		<view v-if="0==TabCur">
			<!-- 币币 -->
			<btcOrder  ></btcOrder>
		</view>
		<view v-if="1==TabCur">
			<!-- 法币 -->
			<cnyOrder ref="child"></cnyOrder>
		</view>
		<!-- <view v-if="2==TabCur">
			 
			<cnyOrder2  ></cnyOrder2>
		</view> -->
	</view>
</template>

<script>
	import btcOrder from '@/components/btcOrder.vue'
	// import cnyOrder2 from '@/components/cnyOrder2.vue'
	import cnyOrder from '@/components/cnyOrder.vue'
	export default {
		data() {
			return {
				TabCur: 1,
				scrollLeft: 0,
				menu: ['收款方式'],
				uri: ['/pages/address2/address'],
				ptype1: 'wall2',
				ptype2: 'wall1',
				salename: 'BTC',
				buyname: 'USDT',
			}
		},
		computed: { 
			i18n() {
				return this.$t('message');
			}
		},
		components: {
			cnyOrder,
			btcOrder,
			// cnyOrder2
		},
	    onLoad() {
			 uni.setNavigationBarTitle({
            	title: this.i18n.order.title
        	});
			 
		}, 
		onShow() {
			setTimeout(() => { 
				// if(1==this.TabCur){
				// 	this.$refs.child.loadNewsList('refresh');
				// } 
				this.$refs.child.loadNewsList('refresh');
			}, 300)
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
			},
			actionSheetTap() {
				uni.showActionSheet({
					// title:'标题',
					itemList: this.menu,
					success: (e) => {
						uni.navigateTo({
							url: this.uri[e.tapIndex]
						})
					}
				})
			}
		}
	}
</script>

<style>
	.nav .cu-item.cur {
		border-bottom: 0px;
	}
</style>
